package com.songlanyun.modules.account.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户管理的操作日志的实体
 *
 * @author 王熙伟(wang-xiwei@foxmail.com)
 * @since 2024-04-24
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("yxt_account_operation_log")
public class AccountOperationLogEntity extends RootEntity<Long, AccountOperationLogEntity> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     *主键
     */
    @TableId
    private Long id;

    /**
     *操作人账号
     */
    @Excel(name = "操作人账号", orderNum = "1", width = 15D, needMerge = true)
    private Long operatorId;

    /**
     *操作人姓名
     */
    @Excel(name = "操作人姓名", orderNum = "2", width = 15D, needMerge = true)
    private String operatorName;

    /**
     *会员账号
     */
    @Excel(name = "会员账号", orderNum = "3", width = 15D, needMerge = true)
    private Long userId;

    /**
     *会员昵称
     */
    @Excel(name = "会员昵称", orderNum = "4", width = 15D, needMerge = true)
    private String userName;

    /**
     *操作
     */
    @Excel(name = "操作", orderNum = "5", width = 15D, needMerge = true)
    private String operation;

    /**
     *操作前的值
     */
    @Excel(name = "操作前的值", orderNum = "6", width = 15D, needMerge = true)
    private String oldValue;

    /**
     *操作后的值
     */
    @Excel(name = "操作后的值", orderNum = "7", width = 15D, needMerge = true)
    private String newValue;

    /**
     *操作时间
     */
    @Excel(name = "操作时间", orderNum = "8", width = 15D, needMerge = true)
    @JsonFormat(locale = "zh_CN", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     *请求参数
     */
    private String operationValue;

    @Override
    public Long getIdentity() {
        return id;
    }
}
